package com.jinzhuo.music.service;

import com.jinzhuo.music.dao.CommentMapper;
import com.jinzhuo.music.domain.Comment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 评价实现类
 */
@Service
public class CommentServiceImpl implements CommentService {
    @Autowired
    private CommentMapper commentMapper;

    @Override
    public boolean addComment(Comment pojo) {
        return commentMapper.addComment(pojo)>0;
    }

    @Override
    public boolean deleteComment(Integer id) {
        return commentMapper.deleteComment(id)>0;
    }

    @Override
    public boolean updateComment(Comment comment) {
        return commentMapper.updateComment(comment)>0;
    }

    @Override
    public Comment queryComment(Integer id) {
        return commentMapper.queryComment(id);
    }

    @Override
    public List<Comment> queryAllComment() {
        return commentMapper.queryAllComment();
    }

    @Override
    public List<Comment> queryBySongId(Integer songId) {
        return commentMapper.queryBySongId(songId);
    }

    @Override
    public List<Comment> queryBySongListId(Integer songListId) {
        return commentMapper.queryBySongListId(songListId);
    }
}
